package com.itheima.exerciseTest.method10_19.method12;

import java.util.TreeSet;

/*
2.分析以下需求，并用代码实现：
	(1)定义一个员工类Employee，包含三个属性：姓名(String name)、年龄(int age)、工资(int salary)
	(2)创建5个对象装入TreeSet，按照工资从高到底排序输出结果(工资相同，按照年龄从低到高，工资和年龄都相同，
		按照姓名字典顺序排列，但是不能去重(姓名、年龄、工资都相同))
 */
public class Demo {
    public static void main(String[] args) {
        TreeSet<Employee> ts = new TreeSet<>();
        Employee e1 = new Employee("张三",23,10000);
        Employee e2 = new Employee("李四",23,11000);
        Employee e3 = new Employee("asdf",21,12000);
        Employee e4 = new Employee("asfas",22,12000);
        Employee e5 = new Employee("张三",23,10000);

        ts.add(e1);
        ts.add(e2);
        ts.add(e3);
        ts.add(e4);
        ts.add(e5);

        for (Employee t : ts) {
            System.out.println(t);
        }
    }
}
